<?php
/**
 *@author Connor <caokang@foxmail.com>
 *@todo
 *@link www.zeevin.com
 */
class Area extends CActiveRecord{

	public static function model($className=__CLASS__){
		return parent::model($className);
	}

	public function tableName(){
		return 'area';
	}

	public static function getArea($pid=0) {
		// $rs = Area::model()->findAllByAttributes(array('pid'=>$pid));
		// foreach ($rs as $value) {
		// 	$tmp[$value->id]=$value->title;
		// }
		$tmp = array('1375'=>'济南');
		return $tmp;
	}

	public static function getName($id){
		return ($area=Area::model()->findByPk($id))?$area->title:null;
	}

}